package com.asm.server.handler;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelOutboundHandlerAdapter;
import io.netty.channel.ChannelPromise;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class LifeCycleTestHandlerOutbound extends ChannelOutboundHandlerAdapter {
    @Override
    public void disconnect(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception {
        log.debug("<<===== {} ...", new RuntimeException().getStackTrace()[0].getMethodName());
        super.disconnect(ctx, promise);
    }

    @Override
    public void close(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception {
        log.debug("<<===== {} ...", new RuntimeException().getStackTrace()[0].getMethodName());
        super.close(ctx, promise);
    }

    @Override
    public void deregister(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception {
        log.debug("<<===== {} ...", new RuntimeException().getStackTrace()[0].getMethodName());
        super.deregister(ctx, promise);
    }

    @Override
    public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
        log.debug("<<===== {} ...", new RuntimeException().getStackTrace()[0].getMethodName());
        super.handlerAdded(ctx);
    }

    @Override
    public void handlerRemoved(ChannelHandlerContext ctx) throws Exception {
        log.debug("<<===== {} ...", new RuntimeException().getStackTrace()[0].getMethodName());
        super.handlerRemoved(ctx);
    }
}
